package com.lw.test;

/**
 * @Description: 超市
 * @author: 小雷
 * @createTime: 2025-02-13 17:31:40
 */

import lombok.Data;

@Data
class Fruit {
    protected String name;
    protected double price;

    public Fruit(String name, double price) {
        this.name = name;
        this.price = price;
    }

    // 计算指定斤数的水果总价
    public double calculateTotalPrice(int quantity) {
        return price * quantity;
    }
}
